<template>
    <div>
      <div class="main-tab">
        <x-header id="header" slot="header" :left-options="{showBack: false}" >
          <x-icon type="ios-arrow-back" slot="left" style="fill:#fff;" @click="back"></x-icon>
          <span slot="default" class="header-tit">我的黑名单</span>
        </x-header>
        <div class="main">
          <group>
            <cell-box  v-for=" (item, index) in black" :key="item.id">
              <img :src="item.avatar" class="avatar">
              <span class="name">{{item.nickname}}</span>
              <black class="black"></black>
            </cell-box>
          </group>
        </div>
        <div class="more">没有更多了哦～</div>
      </div>
    </div>
</template>

<script>
  import black from '../../components/blackbutton/blackbutton'
  import { getBlacklisted} from '@/api/user';
  import { cookie } from 'vux';

  export default {
        name: "blacklist",
      components:{
          black
      },
      data(){
          return{
            id:'',
            cid:1,
            black:[]
          }
      },
    methods:{
      getBlacklisted(){
        this.cid=JSON.parse(cookie.get('userInfo')).id;
        getBlacklisted(parseInt(this.cid)).then(res =>{
          console.log(res)
          this.black=res.data
        })
      },
      back(){
        this.$router.go(-1)
      },
    },
    created(){
          this.getBlacklisted();
    }
    }
</script>

<style scoped>
  .header-tit{
    margin-top: 0.2rem;
  }
  #header{
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
  }
  .main{
    padding-top:28px;
  }
  .avatar{
    width: 3.57rem;
    height: 3.57rem;
    border: 1px solid #F4F4F4;
    border-radius:50%; overflow:hidden;
  }
  .name{
    font-family: "PingFangSC-Semibold",serif;
    font-size: 17px;
    color: #030303;
    letter-spacing: -0.41px;
    text-align: center;
    margin-left: 1.08rem;
  }
  .more{
    position: absolute;
    left: 50%;
    margin-left: -3.43rem;
    margin-top: 1.07rem;
    font-size: 14px;
    color: #9B9B9B;
    letter-spacing: -0.34px;
    text-align: justify;
  }
  .black{
    position: absolute;
    right: 4%;
  }
</style>
